import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

public class Solution {
    public static void main(String[] args) {
        String s = "aaa";
        System.out.println(canPermutePalindrome(s));
    }
    public static boolean canPermutePalindrome(String s) {
        Set<Character> set = new HashSet<>();
        for(char c : s.toCharArray()) {
            if(!set.add(c)) {
                set.remove(c);
            }
        }
        return set.size() <= 1;
    }
}
